{ "cells": [ { "cell_type": "markdown", "metadata": { "_kg_hide-input": true }, "source": [ "# 1. **Imports** " ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "_kg_hide-input": true, "execution": { "iopub.execute_input": "2022-06-29T00:53:51.475464Z", "iopub.status.busy": "2022-06-29T00:53:51.474970Z", "iopub.status.idle": "2022-06-29T00:54:20.380605Z", "shell.execute_reply": "2022-06-29T00:54:20.379631Z", "shell.execute_reply.started": "2022-06-29T00:53:51.475376Z" } }, "outputs": [], "source": [ "import numpy as np # linear algebra\n", "import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n", "import plotly.express as px # Plot graphics\n", "import plotly.io as pio " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# 2. Reading the data" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "execution": { "iopub.execute_input": "2022-06-29T00:54:20.383462Z", "iopub.status.busy": "2022-06-29T00:54:20.382914Z", "iopub.status.idle": "2022-06-29T00:54:20.401241Z", "shell.execute_reply": "2022-06-29T00:54:20.400285Z", "shell.execute_reply.started": "2022-06-29T00:54:20.383414Z" } }, "outputs": [], "source": [ "df = pd.read_csv('./data/StudentsPerformance.csv')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 2.1 First glances on the dataset" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "execution": { "iopub.execute_input": "2022-06-29T00:54:20.403686Z", "iopub.status.busy": "2022-06-29T00:54:20.403052Z", "iopub.status.idle": "2022-06-29T00:54:20.445012Z", "shell.execute_reply": "2022-06-29T00:54:20.444226Z", "shell.execute_reply.started": "2022-06-29T00:54:20.403641Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
genderrace/ethnicityparental level of educationlunchtest preparation coursemath scorereading scorewriting score
0femalegroup Bbachelor's degreestandardnone727274
1femalegroup Csome collegestandardcompleted699088
2femalegroup Bmaster's degreestandardnone909593
3malegroup Aassociate's degreefree/reducednone475744
4malegroup Csome collegestandardnone767875
\n", "
" ], "text/plain": [ " gender race/ethnicity parental level of education lunch \\\n", "0 female group B bachelor's degree standard \n", "1 female group C some college standard \n", "2 female group B master's degree standard \n", "3 male group A associate's degree free/reduced \n", "4 male group C some college standard \n", "\n", " test preparation course math score reading score writing score \n", "0 none 72 72 74 \n", "1 completed 69 90 88 \n", "2 none 90 95 93 \n", "3 none 47 57 44 \n", "4 none 76 78 75 " ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.head()" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "execution": { "iopub.execute_input": "2022-06-29T00:54:48.107458Z", "iopub.status.busy": "2022-06-29T00:54:48.103360Z", "iopub.status.idle": "2022-06-29T00:54:48.117433Z", "shell.execute_reply": "2022-06-29T00:54:48.115986Z", "shell.execute_reply.started": "2022-06-29T00:54:48.107410Z" } }, "outputs": [ { "data": { "text/plain": [ "gender 0\n", "race/ethnicity 0\n", "parental level of education 0\n", "lunch 0\n", "test preparation course 0\n", "math score 0\n", "reading score 0\n", "writing score 0\n", "dtype: int64" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Identifying if the dataset has null values\n", "\n", "df.isnull().sum()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Looks like our dataset has all rows duly filled." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# 3. Distribution of the grades" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The goal in this part is to have visualizations of the distribution of the numeric variables." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 3.1 Math" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "execution": { "iopub.execute_input": "2022-06-29T00:54:48.119175Z", "iopub.status.busy": "2022-06-29T00:54:48.118819Z", "iopub.status.idle": "2022-06-29T00:54:49.177689Z", "shell.execute_reply": "2022-06-29T00:54:49.176825Z", "shell.execute_reply.started": "2022-06-29T00:54:48.119129Z" } }, "outputs": [ { "data": { "text/html": [ " \n", " " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "alignmentgroup": "True", "hovertemplate": "math score=%{y}", "legendgroup": "", "marker": { "color": "#636efa" }, "name": "", "notched": false, "offsetgroup": "", "orientation": "v", "showlegend": false, "type": "box", "x0": " ", "xaxis": "x", "y": [ 72, 69, 90, 47, 76, 71, 88, 40, 64, 38, 58, 40, 65, 78, 50, 69, 88, 18, 46, 54, 66, 65, 44, 69, 74, 73, 69, 67, 70, 62, 69, 63, 56, 40, 97, 81, 74, 50, 75, 57, 55, 58, 53, 59, 50, 65, 55, 66, 57, 82, 53, 77, 53, 88, 71, 33, 82, 52, 58, 0, 79, 39, 62, 69, 59, 67, 45, 60, 61, 39, 58, 63, 41, 61, 49, 44, 30, 80, 61, 62, 47, 49, 50, 72, 42, 73, 76, 71, 58, 73, 65, 27, 71, 43, 79, 78, 65, 63, 58, 65, 79, 68, 85, 60, 98, 58, 87, 66, 52, 70, 77, 62, 54, 51, 99, 84, 75, 78, 51, 55, 79, 91, 88, 63, 83, 87, 72, 65, 82, 51, 89, 53, 87, 75, 74, 58, 51, 70, 59, 71, 76, 59, 42, 57, 88, 22, 88, 73, 68, 100, 62, 77, 59, 54, 62, 70, 66, 60, 61, 66, 82, 75, 49, 52, 81, 96, 53, 58, 68, 67, 72, 94, 79, 63, 43, 81, 46, 71, 52, 97, 62, 46, 50, 65, 45, 65, 80, 62, 48, 77, 66, 76, 62, 77, 69, 61, 59, 55, 45, 78, 67, 65, 69, 57, 59, 74, 82, 81, 74, 58, 80, 35, 42, 60, 87, 84, 83, 34, 66, 61, 56, 87, 55, 86, 52, 45, 72, 57, 68, 88, 76, 46, 67, 92, 83, 80, 63, 64, 54, 84, 73, 80, 56, 59, 75, 85, 89, 58, 65, 68, 47, 71, 60, 80, 54, 62, 64, 78, 70, 65, 64, 79, 44, 99, 76, 59, 63, 69, 88, 71, 69, 58, 47, 65, 88, 83, 85, 59, 65, 73, 53, 45, 73, 70, 37, 81, 97, 67, 88, 77, 76, 86, 63, 65, 78, 67, 46, 71, 40, 90, 81, 56, 67, 80, 74, 69, 99, 51, 53, 49, 73, 66, 67, 68, 59, 71, 77, 83, 63, 56, 67, 75, 71, 43, 41, 82, 61, 28, 82, 41, 71, 47, 62, 90, 83, 61, 76, 49, 24, 35, 58, 61, 69, 67, 79, 72, 62, 77, 75, 87, 52, 66, 63, 46, 59, 61, 63, 42, 59, 80, 58, 85, 52, 27, 59, 49, 69, 61, 44, 73, 84, 45, 74, 82, 59, 46, 80, 85, 71, 66, 80, 87, 79, 38, 38, 67, 64, 57, 62, 73, 73, 77, 76, 57, 65, 48, 50, 85, 74, 60, 59, 53, 49, 88, 54, 63, 65, 82, 52, 87, 70, 84, 71, 63, 51, 84, 71, 74, 68, 57, 82, 57, 47, 59, 41, 62, 86, 69, 65, 68, 64, 61, 61, 47, 73, 50, 75, 75, 70, 89, 67, 78, 59, 73, 79, 67, 69, 86, 47, 81, 64, 100, 65, 65, 53, 37, 79, 53, 100, 72, 53, 54, 71, 77, 75, 84, 26, 72, 77, 91, 83, 63, 68, 59, 90, 71, 76, 80, 55, 76, 73, 52, 68, 59, 49, 70, 61, 60, 64, 79, 65, 64, 83, 81, 54, 68, 54, 59, 66, 76, 74, 94, 63, 95, 40, 82, 68, 55, 79, 86, 76, 64, 62, 54, 77, 76, 74, 66, 66, 67, 71, 91, 69, 54, 53, 68, 56, 36, 29, 62, 68, 47, 62, 79, 73, 66, 51, 51, 85, 97, 75, 79, 81, 82, 64, 78, 92, 72, 62, 79, 79, 87, 40, 77, 53, 32, 55, 61, 53, 73, 74, 63, 96, 63, 48, 48, 92, 61, 63, 68, 71, 91, 53, 50, 74, 40, 61, 81, 48, 53, 81, 77, 63, 73, 69, 65, 55, 44, 54, 48, 58, 71, 68, 74, 92, 56, 30, 53, 69, 65, 54, 29, 76, 60, 84, 75, 85, 40, 61, 58, 69, 58, 94, 65, 82, 60, 37, 88, 95, 65, 35, 62, 58, 100, 61, 100, 69, 61, 49, 44, 67, 79, 66, 75, 84, 71, 67, 80, 86, 76, 41, 74, 72, 74, 70, 65, 59, 64, 50, 69, 51, 68, 85, 65, 73, 62, 77, 69, 43, 90, 74, 73, 55, 65, 80, 50, 63, 77, 73, 81, 66, 52, 69, 65, 69, 50, 73, 70, 81, 63, 67, 60, 62, 29, 62, 94, 85, 77, 53, 93, 49, 73, 66, 77, 49, 79, 75, 59, 57, 66, 79, 57, 87, 63, 59, 62, 46, 66, 89, 42, 93, 80, 98, 81, 60, 76, 73, 96, 76, 91, 62, 55, 74, 50, 47, 81, 65, 68, 73, 53, 68, 55, 87, 55, 53, 67, 92, 53, 81, 61, 80, 37, 81, 59, 55, 72, 69, 69, 50, 87, 71, 68, 79, 77, 58, 84, 55, 70, 52, 69, 53, 48, 78, 62, 60, 74, 58, 76, 68, 58, 52, 75, 52, 62, 66, 49, 66, 35, 72, 94, 46, 77, 76, 52, 91, 32, 72, 19, 68, 52, 48, 60, 66, 89, 42, 57, 70, 70, 69, 52, 67, 76, 87, 82, 73, 75, 64, 41, 90, 59, 51, 45, 54, 87, 72, 94, 45, 61, 60, 77, 85, 78, 49, 71, 48, 62, 56, 65, 69, 68, 61, 74, 64, 77, 58, 60, 73, 75, 58, 66, 39, 64, 23, 74, 40, 90, 91, 64, 59, 80, 71, 61, 87, 82, 62, 97, 75, 65, 52, 87, 53, 81, 39, 71, 97, 82, 59, 61, 78, 49, 59, 70, 82, 90, 43, 80, 81, 57, 59, 64, 63, 71, 64, 55, 51, 62, 93, 54, 69, 44, 86, 85, 50, 88, 59, 32, 36, 63, 67, 65, 85, 73, 34, 93, 67, 88, 57, 79, 67, 70, 50, 69, 52, 47, 46, 68, 100, 44, 57, 91, 69, 35, 72, 54, 74, 74, 64, 65, 46, 48, 67, 62, 61, 70, 98, 70, 67, 57, 85, 77, 72, 78, 81, 61, 58, 54, 82, 49, 49, 57, 94, 75, 74, 58, 62, 72, 84, 92, 45, 75, 56, 48, 100, 65, 72, 62, 66, 63, 68, 75, 89, 78, 53, 49, 54, 64, 60, 62, 55, 91, 8, 81, 79, 78, 74, 57, 40, 81, 44, 67, 86, 65, 55, 62, 63, 88, 62, 59, 68, 77 ], "y0": " ", "yaxis": "y" } ], "layout": { "boxmode": "group", "legend": { "tracegroupgap": 0 }, "margin": { "t": 60 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "xaxis": { "anchor": "y", "domain": [ 0, 1 ] }, "yaxis": { "anchor": "x", "domain": [ 0, 1 ], "title": { "text": "math score" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "fig = px.box(df, y=\"math score\")\n", "fig.show()" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "execution": { "iopub.execute_input": "2022-06-29T00:54:49.179162Z", "iopub.status.busy": "2022-06-29T00:54:49.178928Z", "iopub.status.idle": "2022-06-29T00:54:49.269058Z", "shell.execute_reply": "2022-06-29T00:54:49.268187Z", "shell.execute_reply.started": "2022-06-29T00:54:49.179132Z" } }, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "alignmentgroup": "True", "bingroup": "x", "hovertemplate": "math score=%{x}
count=%{y}", "legendgroup": "", "marker": { "color": "#636efa", "pattern": { "shape": "" } }, "name": "", "offsetgroup": "", "orientation": "v", "showlegend": false, "type": "histogram", "x": [ 72, 69, 90, 47, 76, 71, 88, 40, 64, 38, 58, 40, 65, 78, 50, 69, 88, 18, 46, 54, 66, 65, 44, 69, 74, 73, 69, 67, 70, 62, 69, 63, 56, 40, 97, 81, 74, 50, 75, 57, 55, 58, 53, 59, 50, 65, 55, 66, 57, 82, 53, 77, 53, 88, 71, 33, 82, 52, 58, 0, 79, 39, 62, 69, 59, 67, 45, 60, 61, 39, 58, 63, 41, 61, 49, 44, 30, 80, 61, 62, 47, 49, 50, 72, 42, 73, 76, 71, 58, 73, 65, 27, 71, 43, 79, 78, 65, 63, 58, 65, 79, 68, 85, 60, 98, 58, 87, 66, 52, 70, 77, 62, 54, 51, 99, 84, 75, 78, 51, 55, 79, 91, 88, 63, 83, 87, 72, 65, 82, 51, 89, 53, 87, 75, 74, 58, 51, 70, 59, 71, 76, 59, 42, 57, 88, 22, 88, 73, 68, 100, 62, 77, 59, 54, 62, 70, 66, 60, 61, 66, 82, 75, 49, 52, 81, 96, 53, 58, 68, 67, 72, 94, 79, 63, 43, 81, 46, 71, 52, 97, 62, 46, 50, 65, 45, 65, 80, 62, 48, 77, 66, 76, 62, 77, 69, 61, 59, 55, 45, 78, 67, 65, 69, 57, 59, 74, 82, 81, 74, 58, 80, 35, 42, 60, 87, 84, 83, 34, 66, 61, 56, 87, 55, 86, 52, 45, 72, 57, 68, 88, 76, 46, 67, 92, 83, 80, 63, 64, 54, 84, 73, 80, 56, 59, 75, 85, 89, 58, 65, 68, 47, 71, 60, 80, 54, 62, 64, 78, 70, 65, 64, 79, 44, 99, 76, 59, 63, 69, 88, 71, 69, 58, 47, 65, 88, 83, 85, 59, 65, 73, 53, 45, 73, 70, 37, 81, 97, 67, 88, 77, 76, 86, 63, 65, 78, 67, 46, 71, 40, 90, 81, 56, 67, 80, 74, 69, 99, 51, 53, 49, 73, 66, 67, 68, 59, 71, 77, 83, 63, 56, 67, 75, 71, 43, 41, 82, 61, 28, 82, 41, 71, 47, 62, 90, 83, 61, 76, 49, 24, 35, 58, 61, 69, 67, 79, 72, 62, 77, 75, 87, 52, 66, 63, 46, 59, 61, 63, 42, 59, 80, 58, 85, 52, 27, 59, 49, 69, 61, 44, 73, 84, 45, 74, 82, 59, 46, 80, 85, 71, 66, 80, 87, 79, 38, 38, 67, 64, 57, 62, 73, 73, 77, 76, 57, 65, 48, 50, 85, 74, 60, 59, 53, 49, 88, 54, 63, 65, 82, 52, 87, 70, 84, 71, 63, 51, 84, 71, 74, 68, 57, 82, 57, 47, 59, 41, 62, 86, 69, 65, 68, 64, 61, 61, 47, 73, 50, 75, 75, 70, 89, 67, 78, 59, 73, 79, 67, 69, 86, 47, 81, 64, 100, 65, 65, 53, 37, 79, 53, 100, 72, 53, 54, 71, 77, 75, 84, 26, 72, 77, 91, 83, 63, 68, 59, 90, 71, 76, 80, 55, 76, 73, 52, 68, 59, 49, 70, 61, 60, 64, 79, 65, 64, 83, 81, 54, 68, 54, 59, 66, 76, 74, 94, 63, 95, 40, 82, 68, 55, 79, 86, 76, 64, 62, 54, 77, 76, 74, 66, 66, 67, 71, 91, 69, 54, 53, 68, 56, 36, 29, 62, 68, 47, 62, 79, 73, 66, 51, 51, 85, 97, 75, 79, 81, 82, 64, 78, 92, 72, 62, 79, 79, 87, 40, 77, 53, 32, 55, 61, 53, 73, 74, 63, 96, 63, 48, 48, 92, 61, 63, 68, 71, 91, 53, 50, 74, 40, 61, 81, 48, 53, 81, 77, 63, 73, 69, 65, 55, 44, 54, 48, 58, 71, 68, 74, 92, 56, 30, 53, 69, 65, 54, 29, 76, 60, 84, 75, 85, 40, 61, 58, 69, 58, 94, 65, 82, 60, 37, 88, 95, 65, 35, 62, 58, 100, 61, 100, 69, 61, 49, 44, 67, 79, 66, 75, 84, 71, 67, 80, 86, 76, 41, 74, 72, 74, 70, 65, 59, 64, 50, 69, 51, 68, 85, 65, 73, 62, 77, 69, 43, 90, 74, 73, 55, 65, 80, 50, 63, 77, 73, 81, 66, 52, 69, 65, 69, 50, 73, 70, 81, 63, 67, 60, 62, 29, 62, 94, 85, 77, 53, 93, 49, 73, 66, 77, 49, 79, 75, 59, 57, 66, 79, 57, 87, 63, 59, 62, 46, 66, 89, 42, 93, 80, 98, 81, 60, 76, 73, 96, 76, 91, 62, 55, 74, 50, 47, 81, 65, 68, 73, 53, 68, 55, 87, 55, 53, 67, 92, 53, 81, 61, 80, 37, 81, 59, 55, 72, 69, 69, 50, 87, 71, 68, 79, 77, 58, 84, 55, 70, 52, 69, 53, 48, 78, 62, 60, 74, 58, 76, 68, 58, 52, 75, 52, 62, 66, 49, 66, 35, 72, 94, 46, 77, 76, 52, 91, 32, 72, 19, 68, 52, 48, 60, 66, 89, 42, 57, 70, 70, 69, 52, 67, 76, 87, 82, 73, 75, 64, 41, 90, 59, 51, 45, 54, 87, 72, 94, 45, 61, 60, 77, 85, 78, 49, 71, 48, 62, 56, 65, 69, 68, 61, 74, 64, 77, 58, 60, 73, 75, 58, 66, 39, 64, 23, 74, 40, 90, 91, 64, 59, 80, 71, 61, 87, 82, 62, 97, 75, 65, 52, 87, 53, 81, 39, 71, 97, 82, 59, 61, 78, 49, 59, 70, 82, 90, 43, 80, 81, 57, 59, 64, 63, 71, 64, 55, 51, 62, 93, 54, 69, 44, 86, 85, 50, 88, 59, 32, 36, 63, 67, 65, 85, 73, 34, 93, 67, 88, 57, 79, 67, 70, 50, 69, 52, 47, 46, 68, 100, 44, 57, 91, 69, 35, 72, 54, 74, 74, 64, 65, 46, 48, 67, 62, 61, 70, 98, 70, 67, 57, 85, 77, 72, 78, 81, 61, 58, 54, 82, 49, 49, 57, 94, 75, 74, 58, 62, 72, 84, 92, 45, 75, 56, 48, 100, 65, 72, 62, 66, 63, 68, 75, 89, 78, 53, 49, 54, 64, 60, 62, 55, 91, 8, 81, 79, 78, 74, 57, 40, 81, 44, 67, 86, 65, 55, 62, 63, 88, 62, 59, 68, 77 ], "xaxis": "x", "yaxis": "y" } ], "layout": { "barmode": "relative", "legend": { "tracegroupgap": 0 }, "margin": { "t": 60 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "xaxis": { "anchor": "y", "domain": [ 0, 1 ], "title": { "text": "math score" } }, "yaxis": { "anchor": "x", "domain": [ 0, 1 ], "title": { "text": "count" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "fig = px.histogram(df, x=\"math score\")\n", "fig.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 3.2 Reading" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "execution": { "iopub.execute_input": "2022-06-29T00:54:49.270439Z", "iopub.status.busy": "2022-06-29T00:54:49.270197Z", "iopub.status.idle": "2022-06-29T00:54:49.336195Z", "shell.execute_reply": "2022-06-29T00:54:49.335377Z", "shell.execute_reply.started": "2022-06-29T00:54:49.270409Z" } }, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "alignmentgroup": "True", "hovertemplate": "reading score=%{y}", "legendgroup": "", "marker": { "color": "#636efa" }, "name": "", "notched": false, "offsetgroup": "", "orientation": "v", "showlegend": false, "type": "box", "x0": " ", "xaxis": "x", "y": [ 72, 90, 95, 57, 78, 83, 95, 43, 64, 60, 54, 52, 81, 72, 53, 75, 89, 32, 42, 58, 69, 75, 54, 73, 71, 74, 54, 69, 70, 70, 74, 65, 72, 42, 87, 81, 81, 64, 90, 56, 61, 73, 58, 65, 56, 54, 65, 71, 74, 84, 55, 69, 44, 78, 84, 41, 85, 55, 59, 17, 74, 39, 61, 80, 58, 64, 37, 72, 58, 64, 63, 55, 51, 57, 49, 41, 26, 78, 74, 68, 49, 45, 47, 64, 39, 80, 83, 71, 70, 86, 72, 34, 79, 45, 86, 81, 66, 72, 67, 67, 67, 74, 91, 44, 86, 67, 100, 63, 76, 64, 89, 55, 53, 58, 100, 77, 85, 82, 63, 69, 92, 89, 93, 57, 80, 95, 68, 77, 82, 49, 84, 37, 74, 81, 79, 55, 54, 55, 66, 61, 72, 62, 55, 43, 73, 39, 84, 68, 75, 100, 67, 67, 70, 49, 67, 89, 74, 60, 86, 62, 78, 88, 53, 53, 92, 100, 51, 76, 83, 75, 73, 88, 86, 67, 51, 91, 54, 77, 70, 100, 68, 64, 50, 69, 52, 67, 76, 66, 52, 88, 65, 83, 64, 62, 84, 55, 69, 56, 53, 79, 84, 81, 77, 69, 41, 71, 62, 80, 81, 61, 79, 28, 62, 51, 91, 83, 86, 42, 77, 56, 68, 85, 65, 80, 66, 56, 72, 50, 72, 95, 64, 43, 86, 87, 82, 75, 66, 60, 52, 80, 68, 83, 52, 51, 74, 76, 76, 70, 64, 60, 49, 83, 70, 80, 52, 73, 73, 77, 75, 81, 79, 79, 50, 93, 73, 42, 75, 72, 92, 76, 63, 49, 53, 70, 85, 78, 92, 63, 86, 56, 52, 48, 79, 78, 46, 82, 82, 89, 75, 76, 70, 73, 60, 73, 77, 62, 41, 74, 46, 87, 78, 54, 84, 76, 75, 67, 87, 52, 71, 57, 76, 60, 61, 67, 64, 66, 82, 72, 71, 65, 79, 86, 81, 53, 46, 90, 61, 23, 75, 55, 60, 37, 56, 78, 93, 68, 70, 51, 38, 55, 61, 73, 76, 72, 73, 80, 61, 94, 74, 74, 65, 57, 78, 58, 71, 72, 61, 66, 62, 90, 62, 84, 58, 34, 60, 58, 58, 66, 64, 84, 77, 73, 74, 97, 70, 43, 90, 95, 83, 64, 86, 100, 81, 49, 43, 76, 73, 78, 64, 70, 67, 68, 67, 54, 74, 45, 67, 89, 63, 59, 54, 43, 65, 99, 59, 73, 65, 80, 57, 84, 71, 83, 66, 67, 72, 73, 74, 73, 59, 56, 93, 58, 58, 85, 39, 67, 83, 71, 59, 63, 66, 72, 56, 59, 66, 48, 68, 66, 56, 88, 81, 81, 73, 83, 82, 74, 66, 81, 46, 73, 85, 92, 77, 58, 61, 56, 89, 54, 100, 65, 58, 54, 70, 90, 58, 87, 31, 67, 88, 74, 85, 69, 86, 67, 90, 76, 62, 68, 64, 71, 71, 59, 68, 52, 52, 74, 47, 75, 53, 82, 85, 64, 83, 88, 64, 64, 48, 78, 69, 71, 79, 87, 61, 89, 59, 82, 70, 59, 78, 92, 71, 50, 49, 61, 97, 87, 89, 74, 78, 78, 49, 86, 58, 59, 52, 60, 61, 53, 41, 74, 67, 54, 61, 88, 69, 83, 60, 66, 66, 92, 69, 82, 77, 95, 63, 83, 100, 67, 67, 72, 76, 90, 48, 62, 45, 39, 72, 67, 70, 66, 75, 74, 90, 80, 51, 43, 100, 71, 48, 68, 75, 96, 62, 66, 81, 55, 51, 91, 56, 61, 97, 79, 73, 75, 77, 76, 73, 63, 64, 66, 57, 62, 68, 76, 100, 79, 24, 54, 77, 82, 60, 29, 78, 57, 89, 72, 84, 58, 64, 63, 60, 59, 90, 77, 93, 68, 45, 78, 81, 73, 61, 63, 51, 96, 58, 97, 70, 48, 57, 51, 64, 60, 74, 88, 84, 74, 80, 92, 76, 74, 52, 88, 81, 79, 65, 81, 70, 62, 53, 79, 56, 80, 86, 70, 79, 67, 67, 66, 60, 87, 77, 66, 71, 69, 63, 60, 73, 85, 74, 72, 76, 57, 78, 84, 77, 64, 78, 82, 75, 61, 72, 68, 55, 40, 66, 99, 75, 78, 58, 90, 53, 76, 74, 77, 63, 89, 82, 72, 78, 66, 81, 67, 84, 64, 63, 72, 34, 59, 87, 61, 84, 85, 100, 81, 70, 94, 78, 96, 76, 73, 72, 59, 90, 48, 43, 74, 75, 51, 92, 39, 77, 46, 89, 47, 58, 57, 79, 66, 71, 60, 73, 57, 84, 73, 55, 79, 75, 64, 60, 84, 69, 72, 77, 90, 55, 95, 58, 68, 59, 77, 72, 58, 81, 62, 63, 72, 75, 62, 71, 60, 48, 73, 67, 78, 65, 58, 72, 44, 79, 85, 56, 90, 85, 59, 81, 51, 79, 38, 65, 65, 62, 66, 74, 84, 52, 68, 70, 84, 60, 55, 73, 80, 94, 85, 76, 81, 74, 45, 75, 54, 31, 47, 64, 84, 80, 86, 59, 70, 72, 91, 90, 90, 52, 87, 58, 67, 68, 69, 86, 54, 60, 86, 60, 82, 50, 64, 64, 82, 57, 77, 52, 58, 44, 77, 65, 85, 85, 54, 72, 75, 67, 68, 85, 67, 64, 97, 68, 79, 49, 73, 62, 86, 42, 71, 93, 82, 53, 42, 74, 51, 58, 72, 84, 90, 62, 64, 82, 61, 72, 76, 64, 70, 73, 46, 51, 76, 100, 72, 65, 51, 85, 92, 67, 74, 62, 34, 29, 78, 54, 78, 84, 78, 48, 100, 84, 77, 48, 84, 75, 64, 42, 84, 61, 62, 61, 70, 100, 61, 77, 96, 70, 53, 66, 65, 70, 64, 56, 61, 43, 56, 74, 57, 71, 75, 87, 63, 57, 58, 81, 68, 66, 91, 66, 62, 68, 61, 82, 58, 50, 75, 73, 77, 74, 52, 69, 57, 87, 100, 63, 81, 58, 54, 100, 76, 57, 70, 68, 63, 76, 84, 100, 72, 50, 65, 63, 82, 62, 65, 41, 95, 24, 78, 85, 87, 75, 51, 59, 75, 45, 86, 81, 82, 76, 72, 63, 99, 55, 71, 78, 86 ], "y0": " ", "yaxis": "y" } ], "layout": { "boxmode": "group", "legend": { "tracegroupgap": 0 }, "margin": { "t": 60 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "xaxis": { "anchor": "y", "domain": [ 0, 1 ] }, "yaxis": { "anchor": "x", "domain": [ 0, 1 ], "title": { "text": "reading score" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "fig = px.box(df, y=\"reading score\")\n", "fig.show()" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "execution": { "iopub.execute_input": "2022-06-29T00:54:49.337744Z", "iopub.status.busy": "2022-06-29T00:54:49.337521Z", "iopub.status.idle": "2022-06-29T00:54:49.407985Z", "shell.execute_reply": "2022-06-29T00:54:49.407168Z", "shell.execute_reply.started": "2022-06-29T00:54:49.337715Z" } }, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "alignmentgroup": "True", "bingroup": "x", "hovertemplate": "reading score=%{x}
count=%{y}", "legendgroup": "", "marker": { "color": "#636efa", "pattern": { "shape": "" } }, "name": "", "offsetgroup": "", "orientation": "v", "showlegend": false, "type": "histogram", "x": [ 72, 90, 95, 57, 78, 83, 95, 43, 64, 60, 54, 52, 81, 72, 53, 75, 89, 32, 42, 58, 69, 75, 54, 73, 71, 74, 54, 69, 70, 70, 74, 65, 72, 42, 87, 81, 81, 64, 90, 56, 61, 73, 58, 65, 56, 54, 65, 71, 74, 84, 55, 69, 44, 78, 84, 41, 85, 55, 59, 17, 74, 39, 61, 80, 58, 64, 37, 72, 58, 64, 63, 55, 51, 57, 49, 41, 26, 78, 74, 68, 49, 45, 47, 64, 39, 80, 83, 71, 70, 86, 72, 34, 79, 45, 86, 81, 66, 72, 67, 67, 67, 74, 91, 44, 86, 67, 100, 63, 76, 64, 89, 55, 53, 58, 100, 77, 85, 82, 63, 69, 92, 89, 93, 57, 80, 95, 68, 77, 82, 49, 84, 37, 74, 81, 79, 55, 54, 55, 66, 61, 72, 62, 55, 43, 73, 39, 84, 68, 75, 100, 67, 67, 70, 49, 67, 89, 74, 60, 86, 62, 78, 88, 53, 53, 92, 100, 51, 76, 83, 75, 73, 88, 86, 67, 51, 91, 54, 77, 70, 100, 68, 64, 50, 69, 52, 67, 76, 66, 52, 88, 65, 83, 64, 62, 84, 55, 69, 56, 53, 79, 84, 81, 77, 69, 41, 71, 62, 80, 81, 61, 79, 28, 62, 51, 91, 83, 86, 42, 77, 56, 68, 85, 65, 80, 66, 56, 72, 50, 72, 95, 64, 43, 86, 87, 82, 75, 66, 60, 52, 80, 68, 83, 52, 51, 74, 76, 76, 70, 64, 60, 49, 83, 70, 80, 52, 73, 73, 77, 75, 81, 79, 79, 50, 93, 73, 42, 75, 72, 92, 76, 63, 49, 53, 70, 85, 78, 92, 63, 86, 56, 52, 48, 79, 78, 46, 82, 82, 89, 75, 76, 70, 73, 60, 73, 77, 62, 41, 74, 46, 87, 78, 54, 84, 76, 75, 67, 87, 52, 71, 57, 76, 60, 61, 67, 64, 66, 82, 72, 71, 65, 79, 86, 81, 53, 46, 90, 61, 23, 75, 55, 60, 37, 56, 78, 93, 68, 70, 51, 38, 55, 61, 73, 76, 72, 73, 80, 61, 94, 74, 74, 65, 57, 78, 58, 71, 72, 61, 66, 62, 90, 62, 84, 58, 34, 60, 58, 58, 66, 64, 84, 77, 73, 74, 97, 70, 43, 90, 95, 83, 64, 86, 100, 81, 49, 43, 76, 73, 78, 64, 70, 67, 68, 67, 54, 74, 45, 67, 89, 63, 59, 54, 43, 65, 99, 59, 73, 65, 80, 57, 84, 71, 83, 66, 67, 72, 73, 74, 73, 59, 56, 93, 58, 58, 85, 39, 67, 83, 71, 59, 63, 66, 72, 56, 59, 66, 48, 68, 66, 56, 88, 81, 81, 73, 83, 82, 74, 66, 81, 46, 73, 85, 92, 77, 58, 61, 56, 89, 54, 100, 65, 58, 54, 70, 90, 58, 87, 31, 67, 88, 74, 85, 69, 86, 67, 90, 76, 62, 68, 64, 71, 71, 59, 68, 52, 52, 74, 47, 75, 53, 82, 85, 64, 83, 88, 64, 64, 48, 78, 69, 71, 79, 87, 61, 89, 59, 82, 70, 59, 78, 92, 71, 50, 49, 61, 97, 87, 89, 74, 78, 78, 49, 86, 58, 59, 52, 60, 61, 53, 41, 74, 67, 54, 61, 88, 69, 83, 60, 66, 66, 92, 69, 82, 77, 95, 63, 83, 100, 67, 67, 72, 76, 90, 48, 62, 45, 39, 72, 67, 70, 66, 75, 74, 90, 80, 51, 43, 100, 71, 48, 68, 75, 96, 62, 66, 81, 55, 51, 91, 56, 61, 97, 79, 73, 75, 77, 76, 73, 63, 64, 66, 57, 62, 68, 76, 100, 79, 24, 54, 77, 82, 60, 29, 78, 57, 89, 72, 84, 58, 64, 63, 60, 59, 90, 77, 93, 68, 45, 78, 81, 73, 61, 63, 51, 96, 58, 97, 70, 48, 57, 51, 64, 60, 74, 88, 84, 74, 80, 92, 76, 74, 52, 88, 81, 79, 65, 81, 70, 62, 53, 79, 56, 80, 86, 70, 79, 67, 67, 66, 60, 87, 77, 66, 71, 69, 63, 60, 73, 85, 74, 72, 76, 57, 78, 84, 77, 64, 78, 82, 75, 61, 72, 68, 55, 40, 66, 99, 75, 78, 58, 90, 53, 76, 74, 77, 63, 89, 82, 72, 78, 66, 81, 67, 84, 64, 63, 72, 34, 59, 87, 61, 84, 85, 100, 81, 70, 94, 78, 96, 76, 73, 72, 59, 90, 48, 43, 74, 75, 51, 92, 39, 77, 46, 89, 47, 58, 57, 79, 66, 71, 60, 73, 57, 84, 73, 55, 79, 75, 64, 60, 84, 69, 72, 77, 90, 55, 95, 58, 68, 59, 77, 72, 58, 81, 62, 63, 72, 75, 62, 71, 60, 48, 73, 67, 78, 65, 58, 72, 44, 79, 85, 56, 90, 85, 59, 81, 51, 79, 38, 65, 65, 62, 66, 74, 84, 52, 68, 70, 84, 60, 55, 73, 80, 94, 85, 76, 81, 74, 45, 75, 54, 31, 47, 64, 84, 80, 86, 59, 70, 72, 91, 90, 90, 52, 87, 58, 67, 68, 69, 86, 54, 60, 86, 60, 82, 50, 64, 64, 82, 57, 77, 52, 58, 44, 77, 65, 85, 85, 54, 72, 75, 67, 68, 85, 67, 64, 97, 68, 79, 49, 73, 62, 86, 42, 71, 93, 82, 53, 42, 74, 51, 58, 72, 84, 90, 62, 64, 82, 61, 72, 76, 64, 70, 73, 46, 51, 76, 100, 72, 65, 51, 85, 92, 67, 74, 62, 34, 29, 78, 54, 78, 84, 78, 48, 100, 84, 77, 48, 84, 75, 64, 42, 84, 61, 62, 61, 70, 100, 61, 77, 96, 70, 53, 66, 65, 70, 64, 56, 61, 43, 56, 74, 57, 71, 75, 87, 63, 57, 58, 81, 68, 66, 91, 66, 62, 68, 61, 82, 58, 50, 75, 73, 77, 74, 52, 69, 57, 87, 100, 63, 81, 58, 54, 100, 76, 57, 70, 68, 63, 76, 84, 100, 72, 50, 65, 63, 82, 62, 65, 41, 95, 24, 78, 85, 87, 75, 51, 59, 75, 45, 86, 81, 82, 76, 72, 63, 99, 55, 71, 78, 86 ], "xaxis": "x", "yaxis": "y" } ], "layout": { "barmode": "relative", "legend": { "tracegroupgap": 0 }, "margin": { "t": 60 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "xaxis": { "anchor": "y", "domain": [ 0, 1 ], "title": { "text": "reading score" } }, "yaxis": { "anchor": "x", "domain": [ 0, 1 ], "title": { "text": "count" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "fig = px.histogram(df, x=\"reading score\")\n", "fig.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 3.3 Writing" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "execution": { "iopub.execute_input": "2022-06-29T00:54:49.411944Z", "iopub.status.busy": "2022-06-29T00:54:49.411417Z", "iopub.status.idle": "2022-06-29T00:54:49.477918Z", "shell.execute_reply": "2022-06-29T00:54:49.477081Z", "shell.execute_reply.started": "2022-06-29T00:54:49.411896Z" } }, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "alignmentgroup": "True", "hovertemplate": "writing score=%{y}", "legendgroup": "", "marker": { "color": "#636efa" }, "name": "", "notched": false, "offsetgroup": "", "orientation": "v", "showlegend": false, "type": "box", "x0": " ", "xaxis": "x", "y": [ 74, 88, 93, 44, 75, 78, 92, 39, 67, 50, 52, 43, 73, 70, 58, 78, 86, 28, 46, 61, 63, 70, 53, 73, 80, 72, 55, 75, 65, 75, 74, 61, 65, 38, 82, 79, 83, 59, 88, 57, 54, 68, 65, 66, 54, 57, 62, 76, 76, 82, 48, 68, 42, 75, 87, 43, 86, 49, 58, 10, 72, 34, 55, 71, 59, 61, 37, 74, 56, 57, 73, 63, 48, 56, 41, 38, 22, 81, 72, 68, 50, 45, 54, 63, 34, 82, 88, 74, 67, 82, 74, 36, 71, 50, 92, 82, 62, 70, 62, 62, 67, 74, 89, 47, 90, 72, 100, 64, 70, 72, 98, 49, 47, 54, 100, 74, 82, 79, 61, 65, 89, 92, 93, 56, 73, 86, 67, 74, 74, 51, 82, 40, 70, 84, 75, 48, 41, 56, 67, 69, 71, 64, 54, 47, 78, 33, 75, 66, 81, 93, 69, 68, 66, 47, 61, 88, 78, 60, 87, 64, 74, 85, 52, 49, 91, 100, 51, 78, 78, 70, 74, 78, 81, 70, 54, 87, 58, 77, 62, 100, 75, 66, 47, 70, 49, 65, 65, 68, 45, 87, 69, 79, 66, 62, 85, 52, 65, 51, 55, 76, 86, 77, 69, 68, 42, 78, 62, 76, 76, 66, 79, 27, 60, 56, 81, 75, 88, 39, 70, 56, 74, 73, 62, 75, 73, 54, 71, 54, 64, 94, 66, 42, 83, 78, 84, 77, 67, 74, 51, 80, 66, 83, 55, 43, 69, 71, 74, 68, 62, 53, 49, 83, 70, 72, 52, 70, 68, 77, 78, 81, 77, 78, 51, 90, 68, 41, 81, 77, 95, 70, 61, 42, 58, 71, 76, 73, 93, 75, 80, 57, 42, 46, 84, 78, 46, 82, 88, 82, 76, 77, 68, 70, 57, 75, 80, 60, 43, 68, 50, 75, 81, 52, 81, 64, 83, 69, 81, 44, 67, 52, 80, 57, 68, 69, 75, 65, 91, 78, 69, 63, 84, 79, 80, 53, 43, 94, 62, 19, 77, 51, 61, 35, 53, 81, 95, 66, 69, 43, 27, 60, 52, 63, 74, 67, 67, 75, 57, 95, 66, 76, 69, 52, 80, 57, 70, 70, 61, 69, 61, 89, 59, 78, 58, 32, 58, 60, 53, 61, 58, 85, 71, 70, 72, 96, 73, 41, 82, 100, 77, 62, 83, 95, 71, 45, 43, 75, 70, 67, 64, 75, 59, 77, 67, 56, 77, 41, 63, 95, 57, 54, 67, 43, 55, 100, 62, 68, 63, 77, 56, 85, 74, 78, 60, 67, 79, 69, 68, 67, 62, 54, 93, 64, 67, 80, 34, 62, 86, 65, 53, 54, 59, 70, 55, 50, 66, 53, 64, 73, 51, 82, 79, 80, 69, 76, 73, 77, 60, 80, 42, 72, 85, 97, 74, 49, 62, 47, 89, 48, 100, 68, 55, 45, 76, 91, 62, 91, 38, 65, 85, 76, 90, 74, 84, 61, 91, 83, 66, 72, 70, 67, 68, 56, 61, 46, 54, 71, 56, 74, 57, 82, 76, 70, 90, 90, 68, 66, 52, 76, 68, 72, 82, 92, 54, 92, 54, 80, 66, 54, 77, 87, 73, 43, 52, 62, 94, 85, 84, 73, 78, 79, 52, 84, 57, 50, 49, 59, 60, 43, 47, 70, 73, 53, 58, 94, 68, 83, 58, 62, 71, 86, 68, 80, 79, 89, 66, 80, 97, 64, 64, 69, 65, 88, 50, 64, 40, 33, 79, 66, 70, 62, 79, 74, 92, 80, 46, 45, 100, 78, 47, 67, 70, 92, 56, 64, 71, 53, 52, 89, 58, 68, 96, 80, 78, 80, 77, 76, 73, 62, 65, 65, 54, 50, 64, 73, 99, 72, 15, 48, 73, 81, 63, 30, 80, 51, 90, 62, 82, 54, 62, 65, 63, 66, 91, 74, 93, 72, 38, 83, 84, 68, 54, 56, 52, 86, 62, 99, 63, 46, 46, 55, 70, 65, 81, 85, 80, 64, 81, 88, 74, 73, 51, 90, 79, 80, 60, 81, 65, 68, 55, 81, 53, 76, 98, 74, 79, 67, 64, 61, 58, 85, 73, 63, 69, 67, 63, 60, 71, 87, 61, 77, 68, 50, 76, 84, 78, 66, 76, 76, 78, 60, 74, 60, 54, 44, 68, 100, 68, 73, 44, 83, 53, 78, 81, 73, 56, 86, 90, 70, 79, 59, 82, 72, 87, 67, 64, 65, 36, 52, 79, 58, 90, 85, 99, 84, 74, 87, 72, 99, 74, 80, 70, 59, 88, 42, 41, 71, 77, 57, 84, 37, 80, 43, 94, 44, 57, 59, 84, 73, 73, 55, 72, 56, 82, 72, 47, 74, 71, 68, 59, 86, 68, 65, 75, 85, 53, 92, 52, 72, 65, 77, 64, 54, 86, 63, 59, 72, 77, 60, 75, 57, 49, 74, 72, 79, 60, 55, 70, 43, 82, 82, 57, 84, 82, 62, 79, 44, 77, 32, 61, 61, 60, 70, 69, 77, 51, 73, 70, 81, 54, 57, 68, 73, 95, 87, 78, 74, 75, 40, 69, 51, 36, 49, 67, 76, 83, 87, 64, 76, 68, 88, 92, 93, 51, 82, 52, 58, 70, 76, 81, 53, 57, 89, 58, 89, 45, 74, 57, 79, 53, 73, 46, 51, 36, 76, 64, 84, 85, 50, 68, 69, 67, 63, 93, 61, 55, 96, 65, 81, 46, 72, 53, 87, 38, 80, 91, 88, 52, 41, 72, 51, 47, 76, 78, 82, 61, 66, 84, 54, 80, 74, 66, 70, 71, 44, 54, 80, 95, 59, 74, 48, 91, 85, 73, 75, 69, 38, 27, 79, 63, 82, 89, 74, 41, 100, 84, 77, 51, 91, 72, 70, 48, 82, 66, 66, 55, 66, 100, 52, 80, 91, 67, 46, 66, 65, 69, 60, 52, 71, 44, 51, 70, 62, 73, 74, 90, 58, 53, 57, 85, 69, 72, 96, 64, 61, 61, 58, 80, 60, 52, 73, 71, 83, 72, 54, 69, 62, 81, 100, 59, 71, 64, 53, 100, 75, 58, 72, 64, 60, 67, 80, 100, 69, 60, 61, 67, 77, 60, 58, 48, 94, 23, 78, 86, 91, 82, 54, 51, 76, 45, 83, 75, 78, 76, 74, 62, 95, 55, 65, 77, 86 ], "y0": " ", "yaxis": "y" } ], "layout": { "boxmode": "group", "legend": { "tracegroupgap": 0 }, "margin": { "t": 60 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "xaxis": { "anchor": "y", "domain": [ 0, 1 ] }, "yaxis": { "anchor": "x", "domain": [ 0, 1 ], "title": { "text": "writing score" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "fig = px.box(df, y=\"writing score\")\n", "fig.show()" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "execution": { "iopub.execute_input": "2022-06-29T00:54:49.480093Z", "iopub.status.busy": "2022-06-29T00:54:49.479358Z", "iopub.status.idle": "2022-06-29T00:54:49.550733Z", "shell.execute_reply": "2022-06-29T00:54:49.549848Z", "shell.execute_reply.started": "2022-06-29T00:54:49.480045Z" } }, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "alignmentgroup": "True", "bingroup": "x", "hovertemplate": "writing score=%{x}
count=%{y}", "legendgroup": "", "marker": { "color": "#636efa", "pattern": { "shape": "" } }, "name": "", "offsetgroup": "", "orientation": "v", "showlegend": false, "type": "histogram", "x": [ 74, 88, 93, 44, 75, 78, 92, 39, 67, 50, 52, 43, 73, 70, 58, 78, 86, 28, 46, 61, 63, 70, 53, 73, 80, 72, 55, 75, 65, 75, 74, 61, 65, 38, 82, 79, 83, 59, 88, 57, 54, 68, 65, 66, 54, 57, 62, 76, 76, 82, 48, 68, 42, 75, 87, 43, 86, 49, 58, 10, 72, 34, 55, 71, 59, 61, 37, 74, 56, 57, 73, 63, 48, 56, 41, 38, 22, 81, 72, 68, 50, 45, 54, 63, 34, 82, 88, 74, 67, 82, 74, 36, 71, 50, 92, 82, 62, 70, 62, 62, 67, 74, 89, 47, 90, 72, 100, 64, 70, 72, 98, 49, 47, 54, 100, 74, 82, 79, 61, 65, 89, 92, 93, 56, 73, 86, 67, 74, 74, 51, 82, 40, 70, 84, 75, 48, 41, 56, 67, 69, 71, 64, 54, 47, 78, 33, 75, 66, 81, 93, 69, 68, 66, 47, 61, 88, 78, 60, 87, 64, 74, 85, 52, 49, 91, 100, 51, 78, 78, 70, 74, 78, 81, 70, 54, 87, 58, 77, 62, 100, 75, 66, 47, 70, 49, 65, 65, 68, 45, 87, 69, 79, 66, 62, 85, 52, 65, 51, 55, 76, 86, 77, 69, 68, 42, 78, 62, 76, 76, 66, 79, 27, 60, 56, 81, 75, 88, 39, 70, 56, 74, 73, 62, 75, 73, 54, 71, 54, 64, 94, 66, 42, 83, 78, 84, 77, 67, 74, 51, 80, 66, 83, 55, 43, 69, 71, 74, 68, 62, 53, 49, 83, 70, 72, 52, 70, 68, 77, 78, 81, 77, 78, 51, 90, 68, 41, 81, 77, 95, 70, 61, 42, 58, 71, 76, 73, 93, 75, 80, 57, 42, 46, 84, 78, 46, 82, 88, 82, 76, 77, 68, 70, 57, 75, 80, 60, 43, 68, 50, 75, 81, 52, 81, 64, 83, 69, 81, 44, 67, 52, 80, 57, 68, 69, 75, 65, 91, 78, 69, 63, 84, 79, 80, 53, 43, 94, 62, 19, 77, 51, 61, 35, 53, 81, 95, 66, 69, 43, 27, 60, 52, 63, 74, 67, 67, 75, 57, 95, 66, 76, 69, 52, 80, 57, 70, 70, 61, 69, 61, 89, 59, 78, 58, 32, 58, 60, 53, 61, 58, 85, 71, 70, 72, 96, 73, 41, 82, 100, 77, 62, 83, 95, 71, 45, 43, 75, 70, 67, 64, 75, 59, 77, 67, 56, 77, 41, 63, 95, 57, 54, 67, 43, 55, 100, 62, 68, 63, 77, 56, 85, 74, 78, 60, 67, 79, 69, 68, 67, 62, 54, 93, 64, 67, 80, 34, 62, 86, 65, 53, 54, 59, 70, 55, 50, 66, 53, 64, 73, 51, 82, 79, 80, 69, 76, 73, 77, 60, 80, 42, 72, 85, 97, 74, 49, 62, 47, 89, 48, 100, 68, 55, 45, 76, 91, 62, 91, 38, 65, 85, 76, 90, 74, 84, 61, 91, 83, 66, 72, 70, 67, 68, 56, 61, 46, 54, 71, 56, 74, 57, 82, 76, 70, 90, 90, 68, 66, 52, 76, 68, 72, 82, 92, 54, 92, 54, 80, 66, 54, 77, 87, 73, 43, 52, 62, 94, 85, 84, 73, 78, 79, 52, 84, 57, 50, 49, 59, 60, 43, 47, 70, 73, 53, 58, 94, 68, 83, 58, 62, 71, 86, 68, 80, 79, 89, 66, 80, 97, 64, 64, 69, 65, 88, 50, 64, 40, 33, 79, 66, 70, 62, 79, 74, 92, 80, 46, 45, 100, 78, 47, 67, 70, 92, 56, 64, 71, 53, 52, 89, 58, 68, 96, 80, 78, 80, 77, 76, 73, 62, 65, 65, 54, 50, 64, 73, 99, 72, 15, 48, 73, 81, 63, 30, 80, 51, 90, 62, 82, 54, 62, 65, 63, 66, 91, 74, 93, 72, 38, 83, 84, 68, 54, 56, 52, 86, 62, 99, 63, 46, 46, 55, 70, 65, 81, 85, 80, 64, 81, 88, 74, 73, 51, 90, 79, 80, 60, 81, 65, 68, 55, 81, 53, 76, 98, 74, 79, 67, 64, 61, 58, 85, 73, 63, 69, 67, 63, 60, 71, 87, 61, 77, 68, 50, 76, 84, 78, 66, 76, 76, 78, 60, 74, 60, 54, 44, 68, 100, 68, 73, 44, 83, 53, 78, 81, 73, 56, 86, 90, 70, 79, 59, 82, 72, 87, 67, 64, 65, 36, 52, 79, 58, 90, 85, 99, 84, 74, 87, 72, 99, 74, 80, 70, 59, 88, 42, 41, 71, 77, 57, 84, 37, 80, 43, 94, 44, 57, 59, 84, 73, 73, 55, 72, 56, 82, 72, 47, 74, 71, 68, 59, 86, 68, 65, 75, 85, 53, 92, 52, 72, 65, 77, 64, 54, 86, 63, 59, 72, 77, 60, 75, 57, 49, 74, 72, 79, 60, 55, 70, 43, 82, 82, 57, 84, 82, 62, 79, 44, 77, 32, 61, 61, 60, 70, 69, 77, 51, 73, 70, 81, 54, 57, 68, 73, 95, 87, 78, 74, 75, 40, 69, 51, 36, 49, 67, 76, 83, 87, 64, 76, 68, 88, 92, 93, 51, 82, 52, 58, 70, 76, 81, 53, 57, 89, 58, 89, 45, 74, 57, 79, 53, 73, 46, 51, 36, 76, 64, 84, 85, 50, 68, 69, 67, 63, 93, 61, 55, 96, 65, 81, 46, 72, 53, 87, 38, 80, 91, 88, 52, 41, 72, 51, 47, 76, 78, 82, 61, 66, 84, 54, 80, 74, 66, 70, 71, 44, 54, 80, 95, 59, 74, 48, 91, 85, 73, 75, 69, 38, 27, 79, 63, 82, 89, 74, 41, 100, 84, 77, 51, 91, 72, 70, 48, 82, 66, 66, 55, 66, 100, 52, 80, 91, 67, 46, 66, 65, 69, 60, 52, 71, 44, 51, 70, 62, 73, 74, 90, 58, 53, 57, 85, 69, 72, 96, 64, 61, 61, 58, 80, 60, 52, 73, 71, 83, 72, 54, 69, 62, 81, 100, 59, 71, 64, 53, 100, 75, 58, 72, 64, 60, 67, 80, 100, 69, 60, 61, 67, 77, 60, 58, 48, 94, 23, 78, 86, 91, 82, 54, 51, 76, 45, 83, 75, 78, 76, 74, 62, 95, 55, 65, 77, 86 ], "xaxis": "x", "yaxis": "y" } ], "layout": { "barmode": "relative", "legend": { "tracegroupgap": 0 }, "margin": { "t": 60 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "xaxis": { "anchor": "y", "domain": [ 0, 1 ], "title": { "text": "writing score" } }, "yaxis": { "anchor": "x", "domain": [ 0, 1 ], "title": { "text": "count" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "fig = px.histogram(df, x=\"writing score\")\n", "fig.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# 4. Correlation" ] }, { "cell_type": "code", "execution_count": 23, "metadata": { "execution": { "iopub.execute_input": "2022-06-29T00:54:49.552043Z", "iopub.status.busy": "2022-06-29T00:54:49.551829Z", "iopub.status.idle": "2022-06-29T00:54:49.630777Z", "shell.execute_reply": "2022-06-29T00:54:49.629944Z", "shell.execute_reply.started": "2022-06-29T00:54:49.552015Z" } }, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "dimensions": [ { "axis": { "matches": true }, "label": "math score", "values": [ 72, 69, 90, 47, 76, 71, 88, 40, 64, 38, 58, 40, 65, 78, 50, 69, 88, 18, 46, 54, 66, 65, 44, 69, 74, 73, 69, 67, 70, 62, 69, 63, 56, 40, 97, 81, 74, 50, 75, 57, 55, 58, 53, 59, 50, 65, 55, 66, 57, 82, 53, 77, 53, 88, 71, 33, 82, 52, 58, 0, 79, 39, 62, 69, 59, 67, 45, 60, 61, 39, 58, 63, 41, 61, 49, 44, 30, 80, 61, 62, 47, 49, 50, 72, 42, 73, 76, 71, 58, 73, 65, 27, 71, 43, 79, 78, 65, 63, 58, 65, 79, 68, 85, 60, 98, 58, 87, 66, 52, 70, 77, 62, 54, 51, 99, 84, 75, 78, 51, 55, 79, 91, 88, 63, 83, 87, 72, 65, 82, 51, 89, 53, 87, 75, 74, 58, 51, 70, 59, 71, 76, 59, 42, 57, 88, 22, 88, 73, 68, 100, 62, 77, 59, 54, 62, 70, 66, 60, 61, 66, 82, 75, 49, 52, 81, 96, 53, 58, 68, 67, 72, 94, 79, 63, 43, 81, 46, 71, 52, 97, 62, 46, 50, 65, 45, 65, 80, 62, 48, 77, 66, 76, 62, 77, 69, 61, 59, 55, 45, 78, 67, 65, 69, 57, 59, 74, 82, 81, 74, 58, 80, 35, 42, 60, 87, 84, 83, 34, 66, 61, 56, 87, 55, 86, 52, 45, 72, 57, 68, 88, 76, 46, 67, 92, 83, 80, 63, 64, 54, 84, 73, 80, 56, 59, 75, 85, 89, 58, 65, 68, 47, 71, 60, 80, 54, 62, 64, 78, 70, 65, 64, 79, 44, 99, 76, 59, 63, 69, 88, 71, 69, 58, 47, 65, 88, 83, 85, 59, 65, 73, 53, 45, 73, 70, 37, 81, 97, 67, 88, 77, 76, 86, 63, 65, 78, 67, 46, 71, 40, 90, 81, 56, 67, 80, 74, 69, 99, 51, 53, 49, 73, 66, 67, 68, 59, 71, 77, 83, 63, 56, 67, 75, 71, 43, 41, 82, 61, 28, 82, 41, 71, 47, 62, 90, 83, 61, 76, 49, 24, 35, 58, 61, 69, 67, 79, 72, 62, 77, 75, 87, 52, 66, 63, 46, 59, 61, 63, 42, 59, 80, 58, 85, 52, 27, 59, 49, 69, 61, 44, 73, 84, 45, 74, 82, 59, 46, 80, 85, 71, 66, 80, 87, 79, 38, 38, 67, 64, 57, 62, 73, 73, 77, 76, 57, 65, 48, 50, 85, 74, 60, 59, 53, 49, 88, 54, 63, 65, 82, 52, 87, 70, 84, 71, 63, 51, 84, 71, 74, 68, 57, 82, 57, 47, 59, 41, 62, 86, 69, 65, 68, 64, 61, 61, 47, 73, 50, 75, 75, 70, 89, 67, 78, 59, 73, 79, 67, 69, 86, 47, 81, 64, 100, 65, 65, 53, 37, 79, 53, 100, 72, 53, 54, 71, 77, 75, 84, 26, 72, 77, 91, 83, 63, 68, 59, 90, 71, 76, 80, 55, 76, 73, 52, 68, 59, 49, 70, 61, 60, 64, 79, 65, 64, 83, 81, 54, 68, 54, 59, 66, 76, 74, 94, 63, 95, 40, 82, 68, 55, 79, 86, 76, 64, 62, 54, 77, 76, 74, 66, 66, 67, 71, 91, 69, 54, 53, 68, 56, 36, 29, 62, 68, 47, 62, 79, 73, 66, 51, 51, 85, 97, 75, 79, 81, 82, 64, 78, 92, 72, 62, 79, 79, 87, 40, 77, 53, 32, 55, 61, 53, 73, 74, 63, 96, 63, 48, 48, 92, 61, 63, 68, 71, 91, 53, 50, 74, 40, 61, 81, 48, 53, 81, 77, 63, 73, 69, 65, 55, 44, 54, 48, 58, 71, 68, 74, 92, 56, 30, 53, 69, 65, 54, 29, 76, 60, 84, 75, 85, 40, 61, 58, 69, 58, 94, 65, 82, 60, 37, 88, 95, 65, 35, 62, 58, 100, 61, 100, 69, 61, 49, 44, 67, 79, 66, 75, 84, 71, 67, 80, 86, 76, 41, 74, 72, 74, 70, 65, 59, 64, 50, 69, 51, 68, 85, 65, 73, 62, 77, 69, 43, 90, 74, 73, 55, 65, 80, 50, 63, 77, 73, 81, 66, 52, 69, 65, 69, 50, 73, 70, 81, 63, 67, 60, 62, 29, 62, 94, 85, 77, 53, 93, 49, 73, 66, 77, 49, 79, 75, 59, 57, 66, 79, 57, 87, 63, 59, 62, 46, 66, 89, 42, 93, 80, 98, 81, 60, 76, 73, 96, 76, 91, 62, 55, 74, 50, 47, 81, 65, 68, 73, 53, 68, 55, 87, 55, 53, 67, 92, 53, 81, 61, 80, 37, 81, 59, 55, 72, 69, 69, 50, 87, 71, 68, 79, 77, 58, 84, 55, 70, 52, 69, 53, 48, 78, 62, 60, 74, 58, 76, 68, 58, 52, 75, 52, 62, 66, 49, 66, 35, 72, 94, 46, 77, 76, 52, 91, 32, 72, 19, 68, 52, 48, 60, 66, 89, 42, 57, 70, 70, 69, 52, 67, 76, 87, 82, 73, 75, 64, 41, 90, 59, 51, 45, 54, 87, 72, 94, 45, 61, 60, 77, 85, 78, 49, 71, 48, 62, 56, 65, 69, 68, 61, 74, 64, 77, 58, 60, 73, 75, 58, 66, 39, 64, 23, 74, 40, 90, 91, 64, 59, 80, 71, 61, 87, 82, 62, 97, 75, 65, 52, 87, 53, 81, 39, 71, 97, 82, 59, 61, 78, 49, 59, 70, 82, 90, 43, 80, 81, 57, 59, 64, 63, 71, 64, 55, 51, 62, 93, 54, 69, 44, 86, 85, 50, 88, 59, 32, 36, 63, 67, 65, 85, 73, 34, 93, 67, 88, 57, 79, 67, 70, 50, 69, 52, 47, 46, 68, 100, 44, 57, 91, 69, 35, 72, 54, 74, 74, 64, 65, 46, 48, 67, 62, 61, 70, 98, 70, 67, 57, 85, 77, 72, 78, 81, 61, 58, 54, 82, 49, 49, 57, 94, 75, 74, 58, 62, 72, 84, 92, 45, 75, 56, 48, 100, 65, 72, 62, 66, 63, 68, 75, 89, 78, 53, 49, 54, 64, 60, 62, 55, 91, 8, 81, 79, 78, 74, 57, 40, 81, 44, 67, 86, 65, 55, 62, 63, 88, 62, 59, 68, 77 ] }, { "axis": { "matches": true }, "label": "reading score", "values": [ 72, 90, 95, 57, 78, 83, 95, 43, 64, 60, 54, 52, 81, 72, 53, 75, 89, 32, 42, 58, 69, 75, 54, 73, 71, 74, 54, 69, 70, 70, 74, 65, 72, 42, 87, 81, 81, 64, 90, 56, 61, 73, 58, 65, 56, 54, 65, 71, 74, 84, 55, 69, 44, 78, 84, 41, 85, 55, 59, 17, 74, 39, 61, 80, 58, 64, 37, 72, 58, 64, 63, 55, 51, 57, 49, 41, 26, 78, 74, 68, 49, 45, 47, 64, 39, 80, 83, 71, 70, 86, 72, 34, 79, 45, 86, 81, 66, 72, 67, 67, 67, 74, 91, 44, 86, 67, 100, 63, 76, 64, 89, 55, 53, 58, 100, 77, 85, 82, 63, 69, 92, 89, 93, 57, 80, 95, 68, 77, 82, 49, 84, 37, 74, 81, 79, 55, 54, 55, 66, 61, 72, 62, 55, 43, 73, 39, 84, 68, 75, 100, 67, 67, 70, 49, 67, 89, 74, 60, 86, 62, 78, 88, 53, 53, 92, 100, 51, 76, 83, 75, 73, 88, 86, 67, 51, 91, 54, 77, 70, 100, 68, 64, 50, 69, 52, 67, 76, 66, 52, 88, 65, 83, 64, 62, 84, 55, 69, 56, 53, 79, 84, 81, 77, 69, 41, 71, 62, 80, 81, 61, 79, 28, 62, 51, 91, 83, 86, 42, 77, 56, 68, 85, 65, 80, 66, 56, 72, 50, 72, 95, 64, 43, 86, 87, 82, 75, 66, 60, 52, 80, 68, 83, 52, 51, 74, 76, 76, 70, 64, 60, 49, 83, 70, 80, 52, 73, 73, 77, 75, 81, 79, 79, 50, 93, 73, 42, 75, 72, 92, 76, 63, 49, 53, 70, 85, 78, 92, 63, 86, 56, 52, 48, 79, 78, 46, 82, 82, 89, 75, 76, 70, 73, 60, 73, 77, 62, 41, 74, 46, 87, 78, 54, 84, 76, 75, 67, 87, 52, 71, 57, 76, 60, 61, 67, 64, 66, 82, 72, 71, 65, 79, 86, 81, 53, 46, 90, 61, 23, 75, 55, 60, 37, 56, 78, 93, 68, 70, 51, 38, 55, 61, 73, 76, 72, 73, 80, 61, 94, 74, 74, 65, 57, 78, 58, 71, 72, 61, 66, 62, 90, 62, 84, 58, 34, 60, 58, 58, 66, 64, 84, 77, 73, 74, 97, 70, 43, 90, 95, 83, 64, 86, 100, 81, 49, 43, 76, 73, 78, 64, 70, 67, 68, 67, 54, 74, 45, 67, 89, 63, 59, 54, 43, 65, 99, 59, 73, 65, 80, 57, 84, 71, 83, 66, 67, 72, 73, 74, 73, 59, 56, 93, 58, 58, 85, 39, 67, 83, 71, 59, 63, 66, 72, 56, 59, 66, 48, 68, 66, 56, 88, 81, 81, 73, 83, 82, 74, 66, 81, 46, 73, 85, 92, 77, 58, 61, 56, 89, 54, 100, 65, 58, 54, 70, 90, 58, 87, 31, 67, 88, 74, 85, 69, 86, 67, 90, 76, 62, 68, 64, 71, 71, 59, 68, 52, 52, 74, 47, 75, 53, 82, 85, 64, 83, 88, 64, 64, 48, 78, 69, 71, 79, 87, 61, 89, 59, 82, 70, 59, 78, 92, 71, 50, 49, 61, 97, 87, 89, 74, 78, 78, 49, 86, 58, 59, 52, 60, 61, 53, 41, 74, 67, 54, 61, 88, 69, 83, 60, 66, 66, 92, 69, 82, 77, 95, 63, 83, 100, 67, 67, 72, 76, 90, 48, 62, 45, 39, 72, 67, 70, 66, 75, 74, 90, 80, 51, 43, 100, 71, 48, 68, 75, 96, 62, 66, 81, 55, 51, 91, 56, 61, 97, 79, 73, 75, 77, 76, 73, 63, 64, 66, 57, 62, 68, 76, 100, 79, 24, 54, 77, 82, 60, 29, 78, 57, 89, 72, 84, 58, 64, 63, 60, 59, 90, 77, 93, 68, 45, 78, 81, 73, 61, 63, 51, 96, 58, 97, 70, 48, 57, 51, 64, 60, 74, 88, 84, 74, 80, 92, 76, 74, 52, 88, 81, 79, 65, 81, 70, 62, 53, 79, 56, 80, 86, 70, 79, 67, 67, 66, 60, 87, 77, 66, 71, 69, 63, 60, 73, 85, 74, 72, 76, 57, 78, 84, 77, 64, 78, 82, 75, 61, 72, 68, 55, 40, 66, 99, 75, 78, 58, 90, 53, 76, 74, 77, 63, 89, 82, 72, 78, 66, 81, 67, 84, 64, 63, 72, 34, 59, 87, 61, 84, 85, 100, 81, 70, 94, 78, 96, 76, 73, 72, 59, 90, 48, 43, 74, 75, 51, 92, 39, 77, 46, 89, 47, 58, 57, 79, 66, 71, 60, 73, 57, 84, 73, 55, 79, 75, 64, 60, 84, 69, 72, 77, 90, 55, 95, 58, 68, 59, 77, 72, 58, 81, 62, 63, 72, 75, 62, 71, 60, 48, 73, 67, 78, 65, 58, 72, 44, 79, 85, 56, 90, 85, 59, 81, 51, 79, 38, 65, 65, 62, 66, 74, 84, 52, 68, 70, 84, 60, 55, 73, 80, 94, 85, 76, 81, 74, 45, 75, 54, 31, 47, 64, 84, 80, 86, 59, 70, 72, 91, 90, 90, 52, 87, 58, 67, 68, 69, 86, 54, 60, 86, 60, 82, 50, 64, 64, 82, 57, 77, 52, 58, 44, 77, 65, 85, 85, 54, 72, 75, 67, 68, 85, 67, 64, 97, 68, 79, 49, 73, 62, 86, 42, 71, 93, 82, 53, 42, 74, 51, 58, 72, 84, 90, 62, 64, 82, 61, 72, 76, 64, 70, 73, 46, 51, 76, 100, 72, 65, 51, 85, 92, 67, 74, 62, 34, 29, 78, 54, 78, 84, 78, 48, 100, 84, 77, 48, 84, 75, 64, 42, 84, 61, 62, 61, 70, 100, 61, 77, 96, 70, 53, 66, 65, 70, 64, 56, 61, 43, 56, 74, 57, 71, 75, 87, 63, 57, 58, 81, 68, 66, 91, 66, 62, 68, 61, 82, 58, 50, 75, 73, 77, 74, 52, 69, 57, 87, 100, 63, 81, 58, 54, 100, 76, 57, 70, 68, 63, 76, 84, 100, 72, 50, 65, 63, 82, 62, 65, 41, 95, 24, 78, 85, 87, 75, 51, 59, 75, 45, 86, 81, 82, 76, 72, 63, 99, 55, 71, 78, 86 ] }, { "axis": { "matches": true }, "label": "writing score", "values": [ 74, 88, 93, 44, 75, 78, 92, 39, 67, 50, 52, 43, 73, 70, 58, 78, 86, 28, 46, 61, 63, 70, 53, 73, 80, 72, 55, 75, 65, 75, 74, 61, 65, 38, 82, 79, 83, 59, 88, 57, 54, 68, 65, 66, 54, 57, 62, 76, 76, 82, 48, 68, 42, 75, 87, 43, 86, 49, 58, 10, 72, 34, 55, 71, 59, 61, 37, 74, 56, 57, 73, 63, 48, 56, 41, 38, 22, 81, 72, 68, 50, 45, 54, 63, 34, 82, 88, 74, 67, 82, 74, 36, 71, 50, 92, 82, 62, 70, 62, 62, 67, 74, 89, 47, 90, 72, 100, 64, 70, 72, 98, 49, 47, 54, 100, 74, 82, 79, 61, 65, 89, 92, 93, 56, 73, 86, 67, 74, 74, 51, 82, 40, 70, 84, 75, 48, 41, 56, 67, 69, 71, 64, 54, 47, 78, 33, 75, 66, 81, 93, 69, 68, 66, 47, 61, 88, 78, 60, 87, 64, 74, 85, 52, 49, 91, 100, 51, 78, 78, 70, 74, 78, 81, 70, 54, 87, 58, 77, 62, 100, 75, 66, 47, 70, 49, 65, 65, 68, 45, 87, 69, 79, 66, 62, 85, 52, 65, 51, 55, 76, 86, 77, 69, 68, 42, 78, 62, 76, 76, 66, 79, 27, 60, 56, 81, 75, 88, 39, 70, 56, 74, 73, 62, 75, 73, 54, 71, 54, 64, 94, 66, 42, 83, 78, 84, 77, 67, 74, 51, 80, 66, 83, 55, 43, 69, 71, 74, 68, 62, 53, 49, 83, 70, 72, 52, 70, 68, 77, 78, 81, 77, 78, 51, 90, 68, 41, 81, 77, 95, 70, 61, 42, 58, 71, 76, 73, 93, 75, 80, 57, 42, 46, 84, 78, 46, 82, 88, 82, 76, 77, 68, 70, 57, 75, 80, 60, 43, 68, 50, 75, 81, 52, 81, 64, 83, 69, 81, 44, 67, 52, 80, 57, 68, 69, 75, 65, 91, 78, 69, 63, 84, 79, 80, 53, 43, 94, 62, 19, 77, 51, 61, 35, 53, 81, 95, 66, 69, 43, 27, 60, 52, 63, 74, 67, 67, 75, 57, 95, 66, 76, 69, 52, 80, 57, 70, 70, 61, 69, 61, 89, 59, 78, 58, 32, 58, 60, 53, 61, 58, 85, 71, 70, 72, 96, 73, 41, 82, 100, 77, 62, 83, 95, 71, 45, 43, 75, 70, 67, 64, 75, 59, 77, 67, 56, 77, 41, 63, 95, 57, 54, 67, 43, 55, 100, 62, 68, 63, 77, 56, 85, 74, 78, 60, 67, 79, 69, 68, 67, 62, 54, 93, 64, 67, 80, 34, 62, 86, 65, 53, 54, 59, 70, 55, 50, 66, 53, 64, 73, 51, 82, 79, 80, 69, 76, 73, 77, 60, 80, 42, 72, 85, 97, 74, 49, 62, 47, 89, 48, 100, 68, 55, 45, 76, 91, 62, 91, 38, 65, 85, 76, 90, 74, 84, 61, 91, 83, 66, 72, 70, 67, 68, 56, 61, 46, 54, 71, 56, 74, 57, 82, 76, 70, 90, 90, 68, 66, 52, 76, 68, 72, 82, 92, 54, 92, 54, 80, 66, 54, 77, 87, 73, 43, 52, 62, 94, 85, 84, 73, 78, 79, 52, 84, 57, 50, 49, 59, 60, 43, 47, 70, 73, 53, 58, 94, 68, 83, 58, 62, 71, 86, 68, 80, 79, 89, 66, 80, 97, 64, 64, 69, 65, 88, 50, 64, 40, 33, 79, 66, 70, 62, 79, 74, 92, 80, 46, 45, 100, 78, 47, 67, 70, 92, 56, 64, 71, 53, 52, 89, 58, 68, 96, 80, 78, 80, 77, 76, 73, 62, 65, 65, 54, 50, 64, 73, 99, 72, 15, 48, 73, 81, 63, 30, 80, 51, 90, 62, 82, 54, 62, 65, 63, 66, 91, 74, 93, 72, 38, 83, 84, 68, 54, 56, 52, 86, 62, 99, 63, 46, 46, 55, 70, 65, 81, 85, 80, 64, 81, 88, 74, 73, 51, 90, 79, 80, 60, 81, 65, 68, 55, 81, 53, 76, 98, 74, 79, 67, 64, 61, 58, 85, 73, 63, 69, 67, 63, 60, 71, 87, 61, 77, 68, 50, 76, 84, 78, 66, 76, 76, 78, 60, 74, 60, 54, 44, 68, 100, 68, 73, 44, 83, 53, 78, 81, 73, 56, 86, 90, 70, 79, 59, 82, 72, 87, 67, 64, 65, 36, 52, 79, 58, 90, 85, 99, 84, 74, 87, 72, 99, 74, 80, 70, 59, 88, 42, 41, 71, 77, 57, 84, 37, 80, 43, 94, 44, 57, 59, 84, 73, 73, 55, 72, 56, 82, 72, 47, 74, 71, 68, 59, 86, 68, 65, 75, 85, 53, 92, 52, 72, 65, 77, 64, 54, 86, 63, 59, 72, 77, 60, 75, 57, 49, 74, 72, 79, 60, 55, 70, 43, 82, 82, 57, 84, 82, 62, 79, 44, 77, 32, 61, 61, 60, 70, 69, 77, 51, 73, 70, 81, 54, 57, 68, 73, 95, 87, 78, 74, 75, 40, 69, 51, 36, 49, 67, 76, 83, 87, 64, 76, 68, 88, 92, 93, 51, 82, 52, 58, 70, 76, 81, 53, 57, 89, 58, 89, 45, 74, 57, 79, 53, 73, 46, 51, 36, 76, 64, 84, 85, 50, 68, 69, 67, 63, 93, 61, 55, 96, 65, 81, 46, 72, 53, 87, 38, 80, 91, 88, 52, 41, 72, 51, 47, 76, 78, 82, 61, 66, 84, 54, 80, 74, 66, 70, 71, 44, 54, 80, 95, 59, 74, 48, 91, 85, 73, 75, 69, 38, 27, 79, 63, 82, 89, 74, 41, 100, 84, 77, 51, 91, 72, 70, 48, 82, 66, 66, 55, 66, 100, 52, 80, 91, 67, 46, 66, 65, 69, 60, 52, 71, 44, 51, 70, 62, 73, 74, 90, 58, 53, 57, 85, 69, 72, 96, 64, 61, 61, 58, 80, 60, 52, 73, 71, 83, 72, 54, 69, 62, 81, 100, 59, 71, 64, 53, 100, 75, 58, 72, 64, 60, 67, 80, 100, 69, 60, 61, 67, 77, 60, 58, 48, 94, 23, 78, 86, 91, 82, 54, 51, 76, 45, 83, 75, 78, 76, 74, 62, 95, 55, 65, 77, 86 ] } ], "hovertemplate": "%{xaxis.title.text}=%{x}
%{yaxis.title.text}=%{y}", "legendgroup": "", "marker": { "color": "#636efa", "symbol": "circle" }, "name": "", "showlegend": false, "type": "splom" } ], "layout": { "dragmode": "select", "legend": { "tracegroupgap": 0 }, "margin": { "t": 60 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "fig = px.scatter_matrix(df, dimensions=[\"math score\", \"reading score\", \"writing score\"])\n", "fig.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can see that there is a good positive correlation among the variables." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# 5. How's the proportion between men and women?" ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "execution": { "iopub.execute_input": "2022-06-29T00:54:49.632794Z", "iopub.status.busy": "2022-06-29T00:54:49.632222Z", "iopub.status.idle": "2022-06-29T00:54:49.640807Z", "shell.execute_reply": "2022-06-29T00:54:49.639510Z", "shell.execute_reply.started": "2022-06-29T00:54:49.632680Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "female 0.518\n", "male 0.482\n", "Name: gender, dtype: float64\n" ] } ], "source": [ "df2 = df['gender'].value_counts('gender')\n", "print(df2)" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "execution": { "iopub.execute_input": "2022-06-29T00:54:49.642980Z", "iopub.status.busy": "2022-06-29T00:54:49.642535Z", "iopub.status.idle": "2022-06-29T00:54:49.657055Z", "shell.execute_reply": "2022-06-29T00:54:49.656335Z", "shell.execute_reply.started": "2022-06-29T00:54:49.642932Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "{'female': 518, 'male': 482}\n" ] } ], "source": [ "# Inserting the values above in a python dictionary.\n", "proportion = {}\n", "\n", "proportion['female'] = df[df['gender']=='female']['gender'].count()\n", "proportion['male'] = df[df['gender']=='male']['gender'].count()\n", "\n", "print(proportion)" ] }, { "cell_type": "code", "execution_count": 15, "metadata": { "execution": { "iopub.execute_input": "2022-06-29T00:54:49.658619Z", "iopub.status.busy": "2022-06-29T00:54:49.658254Z", "iopub.status.idle": "2022-06-29T00:54:49.744380Z", "shell.execute_reply": "2022-06-29T00:54:49.743726Z", "shell.execute_reply.started": "2022-06-29T00:54:49.658586Z" } }, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "alignmentgroup": "True", "hovertemplate": "x=%{x}
y=%{y}", "legendgroup": "", "marker": { "color": "#636efa", "pattern": { "shape": "" } }, "name": "", "offsetgroup": "", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ "FEMALE", "MALE" ], "xaxis": "x", "y": [ 518, 482 ], "yaxis": "y" } ], "layout": { "barmode": "relative", "legend": { "tracegroupgap": 0 }, "margin": { "t": 60 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "xaxis": { "anchor": "y", "domain": [ 0, 1 ], "title": { "text": "x" } }, "yaxis": { "anchor": "x", "domain": [ 0, 1 ], "title": { "text": "y" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Data to plot\n", "labels = []\n", "sizes = []\n", "\n", "for x, y in proportion.items():\n", " labels.append(x)\n", " sizes.append(y)\n", " \n", "labels = [x.upper() for x in labels] \n", " \n", " \n", "# Plot\n", "fig = px.bar(x=labels, y=sizes)\n", "fig.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# 6. How's the proportion of parental level of education?" ] }, { "cell_type": "code", "execution_count": 16, "metadata": { "execution": { "iopub.execute_input": "2022-06-29T00:54:49.745797Z", "iopub.status.busy": "2022-06-29T00:54:49.745463Z", "iopub.status.idle": "2022-06-29T00:54:49.753993Z", "shell.execute_reply": "2022-06-29T00:54:49.753161Z", "shell.execute_reply.started": "2022-06-29T00:54:49.745769Z" } }, "outputs": [ { "data": { "text/plain": [ "some college 0.226\n", "associate's degree 0.222\n", "high school 0.196\n", "some high school 0.179\n", "bachelor's degree 0.118\n", "master's degree 0.059\n", "Name: parental level of education, dtype: float64" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df['parental level of education'].value_counts('parental level of education')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# 7. Which kind of lunch do the students prefer?" ] }, { "cell_type": "code", "execution_count": 17, "metadata": { "execution": { "iopub.execute_input": "2022-06-29T00:54:49.755591Z", "iopub.status.busy": "2022-06-29T00:54:49.755234Z", "iopub.status.idle": "2022-06-29T00:54:49.770572Z", "shell.execute_reply": "2022-06-29T00:54:49.769498Z", "shell.execute_reply.started": "2022-06-29T00:54:49.755555Z" } }, "outputs": [ { "data": { "text/plain": [ "standard 0.645\n", "free/reduced 0.355\n", "Name: lunch, dtype: float64" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df['lunch'].value_counts('lunch')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "One can see that most students opt for standart lunch." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# 8. Race" ] }, { "cell_type": "code", "execution_count": 18, "metadata": { "execution": { "iopub.execute_input": "2022-06-29T00:54:49.772490Z", "iopub.status.busy": "2022-06-29T00:54:49.772024Z", "iopub.status.idle": "2022-06-29T00:54:49.786176Z", "shell.execute_reply": "2022-06-29T00:54:49.785400Z", "shell.execute_reply.started": "2022-06-29T00:54:49.772455Z" } }, "outputs": [ { "data": { "text/plain": [ "group C 0.319\n", "group D 0.262\n", "group B 0.190\n", "group E 0.140\n", "group A 0.089\n", "Name: race/ethnicity, dtype: float64" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df['race/ethnicity'].value_counts('race/ethnicity')" ] }, { "cell_type": "code", "execution_count": 19, "metadata": { "execution": { "iopub.execute_input": "2022-06-29T00:54:49.788147Z", "iopub.status.busy": "2022-06-29T00:54:49.787559Z", "iopub.status.idle": "2022-06-29T00:54:49.798445Z", "shell.execute_reply": "2022-06-29T00:54:49.797780Z", "shell.execute_reply.started": "2022-06-29T00:54:49.788113Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "{'group_A': 89, 'group_B': 190, 'group_C': 319, 'group_D': 262, 'group_E': 140}\n" ] } ], "source": [ "# Inserting the values above in a python dictionary.\n", "race2 = {}\n", "\n", "groups = ['A', 'B', 'C', 'D', 'E']\n", "\n", "for i in groups:\n", " \n", " race2[f'group_{i}'] = df[df['race/ethnicity']==f'group {i}']['race/ethnicity'].count()\n", "\n", "print(race2)" ] }, { "cell_type": "code", "execution_count": 20, "metadata": { "execution": { "iopub.execute_input": "2022-06-29T00:54:49.799864Z", "iopub.status.busy": "2022-06-29T00:54:49.799636Z", "iopub.status.idle": "2022-06-29T00:54:49.869166Z", "shell.execute_reply": "2022-06-29T00:54:49.868301Z", "shell.execute_reply.started": "2022-06-29T00:54:49.799836Z" } }, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "alignmentgroup": "True", "hovertemplate": "x=%{x}
y=%{y}", "legendgroup": "", "marker": { "color": "#636efa", "pattern": { "shape": "" } }, "name": "", "offsetgroup": "", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ "group_A", "group_B", "group_C", "group_D", "group_E" ], "xaxis": "x", "y": [ 89, 190, 319, 262, 140 ], "yaxis": "y" } ], "layout": { "barmode": "relative", "legend": { "tracegroupgap": 0 }, "margin": { "t": 60 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "xaxis": { "anchor": "y", "domain": [ 0, 1 ], "title": { "text": "x" } }, "yaxis": { "anchor": "x", "domain": [ 0, 1 ], "title": { "text": "y" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "races = list(race2.keys())\n", "values = list(race2.values())\n", " \n", "# Plot\n", "fig = px.bar(x=races, y=values)\n", "fig.show()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.10" } }, "nbformat": 4, "nbformat_minor": 4 }